import Vue from "vue";
import Router from "vue-router";
import Home from "./views/Home.vue";
import Index from './views/index.vue'
import About from './views/About.vue'
import store from './store/store'

Vue.use(Router);

let router = new Router({
  routes: [
    {
      path: "/",
      component: Index,
      children:[{
        path: "/",
        name: "home",
        component: () =>
          import( "./views/Home.vue" )
      },{
        path: "/about",
        name: "about",
        component: () =>
          import( "./views/About.vue" )
      }]
    },{
      path:"/404",
      name:'404',
      component:() =>
          import( "./views/NotFound/404.vue" )
    },{
      path:"*",
      redirect:{name:'404'}
    }
  ]
});

router.beforeEach(function (to, from, next) {
    next()
});

export default router;
